<?
//获得数据库表格中最旧或者最新的时间:
//$item:记录日期时间的项
//table:表格名称
//condition:最新的还是最旧的
//例子:get_limit_date("finance","applydate","new")
//20418.04.28增加，排除非空值

function get_limit_date($table,$item,$condition)
{

if($condition=="new")
{$condition="desc";}
else
{$condition="asc";}

$sqlstr="select $item from $table where $item !='' order by $item $condition";
  $values = mysqli_fetch_array(do_query($sqlstr))[0];

return $values;

}


?>